package com.nengchuan.eic.nceconomy.fegin;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nengchuan.eic.nceconomy.config.FeignConfiguration;
import com.nengchuan.eic.nceconomy.entity.vo.OrgCategoryVO;
import com.nengchuan.eic.nceconomy.entity.dto.OrgInfoDTO;
import com.nengchuan.eic.nceconomy.entity.vo.OrgUserVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author panwen
 * @description: 单位Feign
 * @create: 2020-05-15 15:08
 * @version: 1.0
 */
@FeignClient(value = "eic-pms-service",path = "/pms",configuration = FeignConfiguration.class)
public interface OrgFeignService {

    @ApiOperation("获取单位分类")
    @GetMapping("/api/v1/unit-types")
    List<OrgCategoryVO> getOrgCategory();

    @ApiOperation("根据分类获取单位信息")
    @GetMapping("/api/v1/units")
    Page<OrgInfoDTO> getOrgInfo(@RequestParam("typeId") Long categoryId,
                                @RequestParam("page") Integer page,
                                @RequestParam("pageSize") Integer pageSize);

    @ApiOperation("获取单位下的用户")
    @GetMapping("/api/v1/users")
    Page<OrgUserVO> getOrgUsers(@RequestParam("unitId") Long unitId,
                                @RequestParam("name") String name,
                                @RequestParam("page") Integer page,
                                @RequestParam("pageSize") Integer pageSize);
}
